import { useResponseSuccess } from '~/utils/response';

export default eventHandler(async (event) => {
  const templateId = getRouterParam(event, 'id');

  // 模拟模板使用情况数据
  const usage = {
    totalResources: 25,
    activeResources: 20,
    inactiveResources: 5,
    usageRate: 80,
    lastUsedTime: '2024-01-17 15:30:00',
    resources: [
      {
        id: '1',
        name: '豪华套房A',
        code: 'ROOM_A_001',
        status: 'ACTIVE',
        applyTime: '2024-01-15 10:30:00',
      },
      {
        id: '2',
        name: '豪华套房B',
        code: 'ROOM_B_001',
        status: 'ACTIVE',
        applyTime: '2024-01-15 11:15:00',
      },
      {
        id: '3',
        name: '豪华套房C',
        code: 'ROOM_C_001',
        status: 'INACTIVE',
        applyTime: '2024-01-16 09:45:00',
      },
    ],
  };

  return useResponseSuccess({
    data: usage,
  });
});
